If a range of cells contains both five-digit and nine-digit ZIP Codes, you can apply a custom format that displays both types of ZIP Codes correctly. In the Category list, click Custom, and then type the following in the Type box:
[<=99999]00000;00000-0000